package com.sicpa.system.service.impl;

import com.sicpa.common.core.domain.entity.AntiCounterfeitingProcessRecord;
import com.sicpa.system.mapper.AntiCounterfeitingProcessRecordMapper;
import com.sicpa.system.service.IAntiCounterfeitingProcessRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;

/**
 * AntiCounterfeitingProcessRecordImpl
 * @author lwf
 */
@Service
public class AntiCounterfeitingProcessRecordImpl implements IAntiCounterfeitingProcessRecordService {

    private AntiCounterfeitingProcessRecordMapper antiCounterfeitingProcessRecordMapper;

    @Autowired
    public AntiCounterfeitingProcessRecordImpl(AntiCounterfeitingProcessRecordMapper antiCounterfeitingProcessRecordMapper) {
        this.antiCounterfeitingProcessRecordMapper = antiCounterfeitingProcessRecordMapper;
    }

    /**
     * 添加操作日志
     * @param optItemId
     * @param optItem
     * @param optResults
     * @param optReason
     * @param createBy
     * @return
     */
    @Override
    public Integer add(Long optItemId,String optItem,String optResults,String optReason,String createBy){
        AntiCounterfeitingProcessRecord record=new AntiCounterfeitingProcessRecord();
        record.setOptItem(optItem);
        record.setOptItemId(optItemId);
        record.setOptResults(optResults);
        record.setOptReason(optReason);
        record.setCreateBy(createBy);
        record.setCreateTime(new Date());
        antiCounterfeitingProcessRecordMapper.insertSelective(record);
        return record.getProcessId();
    }

    /**
     * 添加操作日志
     * @param optItemId
     * @param optItem
     * @param optResults
     * @param createBy
     * @return
     */
    @Override
    public Integer add(Long optItemId,String optItem,String optResults,String createBy){
        return add(optItemId,optItem,optResults,null,createBy);
    }

}
